package com.reflection;


public class GenericClassDef<T> {

	private Class<T> clazz;
	
	public GenericClassDef(Class<T> clazz) {
		this.clazz = clazz;
	}
	
	public T getInstance()throws Exception {
		return clazz.newInstance();
	}

	public static void main(String[] args) throws Exception {
		GenericClassDef<String> g = new GenericClassDef<String>(String.class);
		System.out.println(g.getInstance());
		System.out.println(g.getInstance().getClass());
	}
}
